//
//  ProdouctDetailsHeadView.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/12/26.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class ProdouctDetailsHeadView: UIView {
    
    fileprivate let titleLabel = UILabel()
    fileprivate let selectLabel = UILabel()
    fileprivate let lineView = UIView()

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        titleLabel.text = loanProduct
        titleLabel.textColor = UIColor.white
        titleLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        self.addSubview(titleLabel)
        
        selectLabel.text = selected
        selectLabel.textColor = UIColor.white
        selectLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        self.addSubview(selectLabel)
        
        lineView.backgroundColor = UIColor.white
        self.addSubview(lineView)
        
        selectLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(RATIO_H(maxNum: 20))
            make.bottom.equalToSuperview().offset(RATIO_H(maxNum: -10))
            make.right.equalToSuperview().offset(RATIO(maxNum: -10))
            make.width.equalTo(RATIO(maxNum: 80))
        }
        
        titleLabel.snp.makeConstraints { (make) in
            make.top.bottom.equalTo(selectLabel)
            make.left.equalToSuperview().offset(RATIO(maxNum: 10))
            make.right.equalTo(selectLabel.snp.left).offset(RATIO(maxNum: -5))
        }
        
        lineView.snp.makeConstraints { (make) in
            make.left.equalTo(titleLabel)
            make.right.equalTo(selectLabel)
            make.bottom.equalToSuperview()
            make.height.equalTo(1)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
